define(["app", "angular", "services/BaseService"], function(app, angular) {
	
	var deps = ["$http", "BaseService"];
	
	function autoUpdateManagementResource($http, BaseService) {
        return initResource($http, BaseService.restfulUrl + "version/", BaseService.formHeader);
    }
	
	var postHeader = {
	        "Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	
	function initResource($http, preUrl,formHeader) {
        return {
        	save: function (versionVo) {
				return $http.post(preUrl + "releaseVersion", angular.toJson(versionVo));
			},
			deleteVersion:function(versionId){
                return $http.get(preUrl +versionId+ "/deleteVersion");
            },
            updateStatus:function(versionId,status){
            	return $http.get(preUrl + "updateStatus", {
                    params: {
                    	versionId: versionId,
                    	status: status
                    }
                });
            },
            queryVersionList: function (pageNo,pageSize,keyWord) {
                return $http.get(preUrl + "queryVersionList", {
                    params: {
                        pageSize: pageSize || 10000,
                        pageNo: pageNo || 1,
                        keyWord:keyWord
                    }
                });
            },
        };
        
    }
	autoUpdateManagementResource.$inject = deps;
	app.lazy.factory("AutoUpdateManagementResource", autoUpdateManagementResource);
});
